package giro.general.util;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.Gallery;

public class SinglePageGallery extends Gallery {
	@SuppressWarnings("unused")
	private static final int MAX_VELOCITY = 1000;
	
	public SinglePageGallery(Context context) {
		super(context);
	}

	public SinglePageGallery(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public SinglePageGallery(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}
	
	@Override
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
//		if (Math.abs(velocityX) > MAX_VELOCITY) {
//			velocityX = Math.signum(velocityY) * MAX_VELOCITY;
//		}
//		return super.onFling(e1, e2, velocityX, velocityY);
		return super.onFling(e1, e2, 0, 0);
	}
}
